#!/usr/bin/python
from pylab import *

n = 12
x = arange(n)
y1 = (1-x/float(n))*np.random.uniform(0.5, 1.0, n)
y2 = (1-x/float(n))*np.random.uniform(0.5, 1.0, n)

bar(x, y1, facecolor='#9999ff', edgecolor='white')
bar(x, -y2, facecolor='#ff9999', edgecolor='white')

for ax,ay in zip(x,y1):
    # scatter(ax+0.4,ay+0.05)
    # va='bottom' means the bottom of text is the specific point, ha similar
    text(ax+0.4, ay+0.05, '%.2f'%ay, ha='center', va='bottom') 

for ax,ay in zip(x,y2):
    text(ax+0.4, -ay-0.05, '%.2f'%ay, ha='center', va='top',
    bbox=dict(facecolor='red', alpha=0.5))                   # rectangular box around text
    
show()


# axes([0.025, 0.025, 0.95, 0.95])


# show()
